#include <REGX52.H>
#include "Timer.h"
void Timer0_Init() // 1毫秒@11.0592MHz
{
    TMOD &= 0xF0;
    TMOD |= 0x01;
    TF0 = 0;
    TR0 = 0;
    TL0 = 0; 
    TH0 = 0;
}

void Timer0_SetCounter(unsigned int Value)
{
    TH0=Value/256;
    TL0=Value%256;

}

unsigned int Timer0_GetCounter()
{
    return (TH0<<8)|TL0;
}

void Timer0_Run(bit Flag)
{
    TR0=Flag;
}